package com.xuecheng.auth.controller;

import com.alibaba.fastjson.JSON;
import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import com.aliyun.teautil.models.RuntimeOptions;
import com.xuecheng.ucenter.service.SMSService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Random;

@RestController
@Slf4j
@Api(value = "手机号验证",tags = "手机号验证")
public class SMSController {

    @Autowired
    SMSService smsService;

    @ApiOperation("发送验证码")
    @PostMapping("/phone")
    public  void sendSms(@RequestParam(value = "param1") String param1) throws Exception {
        log.info("发送验证码：{}",param1);
        smsService.sendSms(param1);
    }

    //验证验证码从UserServiceImpl中验证

}
